home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / javax / swing / GroupLayout$ComponentInfo.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  3.3 KB  |  181 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Insets;
  5.  
  6. class GroupLayout$ComponentInfo {
  7.    private Component component;
  8.    GroupLayout.ComponentSpring horizontalSpring;
  9.    GroupLayout.ComponentSpring verticalSpring;
  10.    private GroupLayout.LinkInfo horizontalMaster;
  11.    private GroupLayout.LinkInfo verticalMaster;
  12.    private boolean visible;
  13.    private Boolean honorsVisibility;
  14.    // $FF: synthetic field
  15.    static final boolean $assertionsDisabled = !GroupLayout.class.desiredAssertionStatus();
  16.    // $FF: synthetic field
  17.    final GroupLayout this$0;
  18.  
  19.    GroupLayout$ComponentInfo(GroupLayout var1, Component var2) {
  20.       this.this$0 = var1;
  21.       this.component = var2;
  22.       this.updateVisibility();
  23.    }
  24.  
  25.    public void dispose() {
  26.       this.removeSpring(this.horizontalSpring);
  27.       this.horizontalSpring = null;
  28.       this.removeSpring(this.verticalSpring);
  29.       this.verticalSpring = null;
  30.       if (this.horizontalMaster != null) {
  31.          this.horizontalMaster.remove(this);
  32.       }
  33.  
  34.       if (this.verticalMaster != null) {
  35.          this.verticalMaster.remove(this);
  36.       }
  37.  
  38.    }
  39.  
  40.    void setHonorsVisibility(Boolean var1) {
  41.       this.honorsVisibility = var1;
  42.    }
  43.  
  44.    private void removeSpring(GroupLayout.Spring var1) {
  45.       if (var1 != null) {
  46.          ((GroupLayout.Group)var1.getParent()).springs.remove(var1);
  47.       }
  48.  
  49.    }
  50.  
  51.    public boolean isVisible() {
  52.       return this.visible;
  53.    }
  54.  
  55.    boolean updateVisibility() {
  56.       boolean var1;
  57.       if (this.honorsVisibility == null) {
  58.          var1 = this.this$0.getHonorsVisibility();
  59.       } else {
  60.          var1 = this.honorsVisibility;
  61.       }
  62.  
  63.       boolean var2 = var1 ? this.component.isVisible() : true;
  64.       if (this.visible != var2) {
  65.          this.visible = var2;
  66.          return true;
  67.       } else {
  68.          return false;
  69.       }
  70.    }
  71.  
  72.    public void setBounds(Insets var1, int var2, boolean var3) {
  73.       int var4 = this.horizontalSpring.getOrigin();
  74.       int var5 = this.horizontalSpring.getSize();
  75.       int var6 = this.verticalSpring.getOrigin();
  76.       int var7 = this.verticalSpring.getSize();
  77.       if (!var3) {
  78.          var4 = var2 - var4 - var5;
  79.       }
  80.  
  81.       this.component.setBounds(var4 + var1.left, var6 + var1.top, var5, var7);
  82.    }
  83.  
  84.    public void setComponent(Component var1) {
  85.       this.component = var1;
  86.       if (this.horizontalSpring != null) {
  87.          this.horizontalSpring.setComponent(var1);
  88.       }
  89.  
  90.       if (this.verticalSpring != null) {
  91.          this.verticalSpring.setComponent(var1);
  92.       }
  93.  
  94.    }
  95.  
  96.    public Component getComponent() {
  97.       return this.component;
  98.    }
  99.  
  100.    public boolean isLinked(int var1) {
  101.       if (var1 == 0) {
  102.          return this.horizontalMaster != null;
  103.       } else if (!$assertionsDisabled && var1 != 1) {
  104.          throw new AssertionError();
  105.       } else {
  106.          return this.verticalMaster != null;
  107.       }
  108.    }
  109.  
  110.    private void setLinkInfo(int var1, GroupLayout.LinkInfo var2) {
  111.       if (var1 == 0) {
  112.          this.horizontalMaster = var2;
  113.       } else {
  114.          if (!$assertionsDisabled && var1 != 1) {
  115.             throw new AssertionError();
  116.          }
  117.  
  118.          this.verticalMaster = var2;
  119.       }
  120.  
  121.    }
  122.  
  123.    public GroupLayout.LinkInfo getLinkInfo(int var1) {
  124.       return this.getLinkInfo(var1, true);
  125.    }
  126.  
  127.    private GroupLayout.LinkInfo getLinkInfo(int var1, boolean var2) {
  128.       if (var1 == 0) {
  129.          if (this.horizontalMaster == null && var2) {
  130.             (new GroupLayout.LinkInfo(0)).add(this);
  131.          }
  132.  
  133.          return this.horizontalMaster;
  134.       } else if (!$assertionsDisabled && var1 != 1) {
  135.          throw new AssertionError();
  136.       } else {
  137.          if (this.verticalMaster == null && var2) {
  138.             (new GroupLayout.LinkInfo(1)).add(this);
  139.          }
  140.  
  141.          return this.verticalMaster;
  142.       }
  143.    }
  144.  
  145.    public void clearCachedSize() {
  146.       if (this.horizontalMaster != null) {
  147.          this.horizontalMaster.clearCachedSize();
  148.       }
  149.  
  150.       if (this.verticalMaster != null) {
  151.          this.verticalMaster.clearCachedSize();
  152.       }
  153.  
  154.    }
  155.  
  156.    int getLinkSize(int var1, int var2) {
  157.       if (var1 == 0) {
  158.          return this.horizontalMaster.getSize(var1);
  159.       } else if (!$assertionsDisabled && var1 != 1) {
  160.          throw new AssertionError();
  161.       } else {
  162.          return this.verticalMaster.getSize(var1);
  163.       }
  164.    }
  165.  
  166.    // $FF: synthetic method
  167.    static Component access$000(GroupLayout$ComponentInfo var0) {
  168.       return var0.component;
  169.    }
  170.  
  171.    // $FF: synthetic method
  172.    static GroupLayout.LinkInfo access$1100(GroupLayout$ComponentInfo var0, int var1, boolean var2) {
  173.       return var0.getLinkInfo(var1, var2);
  174.    }
  175.  
  176.    // $FF: synthetic method
  177.    static void access$1200(GroupLayout$ComponentInfo var0, int var1, GroupLayout.LinkInfo var2) {
  178.       var0.setLinkInfo(var1, var2);
  179.    }
  180. }
  181.